package com.foreknow.elm.service.impl;

import com.foreknow.elm.dao.OrderdetailetDao;
import com.foreknow.elm.dao.impl.OrderdetailetDaoImpl;
import com.foreknow.elm.po.Orderdetailet;
import com.foreknow.elm.service.OrderdetailetService;
import com.foreknow.elm.util.DBUtil;

import java.util.ArrayList;
import java.util.List;

public class OrderdetailetServiceImpl implements OrderdetailetService {
    @Override
    public List<Orderdetailet> listOrderDetailetByOrderId(Integer orderId) {
        List<Orderdetailet> list = new ArrayList<>();
        OrderdetailetDao dao = new OrderdetailetDaoImpl();
        try {
            DBUtil.getConnection();
            list = dao.listOrderDetailetByOrderId(orderId);
        } catch(Exception e) {
            e.printStackTrace();
        } finally {
            DBUtil.close();
        }
        return list;
    }
}
